@echo off  
set SERVER_JAR=%cd%\xcloud-tools-gateway-1.0.jar  
set JAVA=C:\Java\jdk1.7.0_80\bin\java11.exe
set JAVA_OPTS=-Xms256m -Xmx256m -XX:PermSize=256M -XX:MaxNewSize=256m -XX:MaxPermSize=256m
  
if not exist "%SERVER_JAR%" (  
@echo "Application is not exist !!!"  
@pause  
exit  
)  

if exist "%JAVA%" goto begin
set JAVA=java

echo off  
if "%1" == "h" goto begin  
rem mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit  

:begin  
echo ====================================
echo ====================================
echo %JAVA% -jar %SERVER_JAR% %JAVA_OPTS%
echo ====================================
echo ====================================  

%JAVA% -jar %SERVER_JAR% %JAVA_OPTS%